/*
 * Automaton.cpp
 *
 *  Created on: 01-09-2013
 *      Author: Krzychu
 */

#include "Automaton.h"

Automaton::Automaton(int vertexNumber, int edgeNumber) : Graph(vertexNumber, edgeNumber)
{
	this->terminal = new bool[vertexNumber];

	for (int i = 0; i < vertexNumber; i++)
	{
		terminal[i] = 0;
	}
}

Automaton::~Automaton()
{

}

void  Automaton::setTerminal(int vertex)
{
	if (vertex < vertexNumber && vertex > -1)
	{
		terminal[vertex] = 1;
	}
}

bool  Automaton::isTerminal(int vertex)
{
	bool result = false;

	if (vertex < vertexNumber && vertex > -1)
	{
		result = terminal[vertex];
	}

	return result;
}

